home *** CD-ROM | disk | FTP | other *** search
/ Apple WWDC 1996 / WWDC96_1996 (CD).toast / Technology Materials / MacApp Release 10 / MacApp Release 10 - HD Ready / Libraries / Framework / Includes / UDragDropBehavior.h < prev    next >
Encoding:
Text File  |  1996-04-03  |  2.0 KB  |  70 lines  |  [TEXT/MPS ]

  1. // UDragDropBehavior
  2. // Copyright © 1994-96 by Apple Computer, Inc. All rights reserved.
  3.  
  4.  
  5. #ifndef __UDRAGDROPBEHAVIOR__
  6. #define __UDRAGDROPBEHAVIOR__
  7.  
  8. // MacApp
  9.  
  10. #ifndef __UBEHAVIOR__
  11. #include "UBehavior.h"
  12. #endif
  13.  
  14. const IDType kDragDropBehavior = 'drag';
  15.  
  16. //----------------------------------------------------------------------------------------
  17. // class TDragDropBehavior
  18. //----------------------------------------------------------------------------------------
  19.  
  20. class TDragDropBehavior : public TBehavior
  21. {
  22.     MA_DECLARE_CLASS;
  23.  
  24. protected:
  25.  
  26.     Boolean    fDraggable;                // indicates whether or not the owner view's contents
  27.                                     // can be dragged
  28.     Boolean    fDroppable;                // indicates whether or not the owner view can receive
  29.                                     // drops
  30.     
  31.     short    fDragMoveDeterminer;    // defines context for drag move. one of the following
  32.                                     // values: kNeverMove, kMoveWithinView, kMoveWithinWindow,
  33.                                     // kMoveWithinContext, kMoveWithinApplication
  34.                                     
  35.     IDType    fDragMoveFamily;        // Used with fDragMoveDeterminer to determine if a drag
  36.                                     // operation should be treated as a copy or a move.
  37.                                     // If the source and target of the drag are within
  38.                                     // the context defined by the source view's fDragMoveDeterminer
  39.                                     // and their fDragMoveFamily values match or are both
  40.                                     // kNoID, it's a move.
  41. public:
  42.     TDragDropBehavior(void);
  43.         // Constructor
  44.     virtual ~TDragDropBehavior();
  45.         // Destructor
  46.  
  47.     virtual void IDragDropBehavior(    IDType itsIdentifier, 
  48.                                     Boolean draggable, 
  49.                                     Boolean droppable,
  50.                                     short    dragMoveDeterminer,
  51.                                     IDType    dragMoveFamily);
  52.         // Initialize the behavior programatically
  53.                                 
  54.     void ReadFrom(TStream* aStream);
  55.         // Read the behavior's data from a stream
  56.  
  57.     void WriteTo(TStream* aStream);
  58.         // Write the behavior's data to a stream
  59.         
  60.     virtual void SetOwner(TEventHandler *itsOwner);
  61.         // Override
  62.     
  63.     virtual IDType GetStandardSignature();
  64.         // Returns this class's standard signature.
  65.  
  66. }; // class TDragDropBehavior
  67.  
  68. #endif // __UDRAGDROPBEHAVIOR__
  69.  
  70.